package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description : 定时控制状态枚举
 * @Date : 2023/8/15 15:43
 * @Modified by : zjf
 */
public enum TimingControlStatusEnum implements EnumMethod{

    EXPIRED(0,"未启用"),
    EFFECTIVE(1,"启用"),;

    private Integer code;
    private String desc;

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    TimingControlStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getDesc() {
        return this.desc;
    }

    public static String getDescFromCode(Integer code){
        for (TimingControlStatusEnum type :TimingControlStatusEnum.values()){
            if (type.code.equals(code)){
                return type.desc;
            }
        }
        return null;
    }
}
